import { Module } from "@nestjs/common";
import { JwtModule } from "@nestjs/jwt";
import { UserModule } from "src/user/user.module";
import { JwtStrategy } from "./jwt.strategy";
import { AuthController } from "./auth.controller";
import { AuthService } from "./auth.service";
import { RoleModule } from "src/role/role.module";
import { SystemModule } from "src/system/system.module";
import { AnnouncementModule } from "src/announcement/announcement.module";



@Module({
    imports: [
        JwtModule.registerAsync({
            useFactory: () => ({
                secret: process.env.secret,
                signOptions: {
                    expiresIn: 60 * 60
                }
            })
        }),
        UserModule,
        RoleModule,
        SystemModule,
        AnnouncementModule
    ],
    controllers: [
        AuthController
    ],
    providers: [
        JwtStrategy,
        AuthService
    ],
    exports: [
        JwtStrategy
    ]
})
export class AuthModule { }